; Set up assigns etc. both for users booting from the CD and from HD
;
; Version 1.1 - Changed jpegtmp
;
; Version 1.2 - Added uninit option
;
; Version 1.3 - Added CHECK argument and link to Prefs editor
;
; Version 1.4 - Added section to copy CUCDfile and IDer.prefs to hard drive if not already present
;
; Version 1.5 - Got rid of calls to updatecopy and replaced them with version/if warn
; Hopefully cured the problem of the CD icon not leaving Workbench after running UninitCD
Assign CUCD: :
;;; Make some commands resident to speed up things on CD32s in particular
Resident >NIL: CUCD:C/RequestChoice PURE
Resident >NIL: CUCD:rexxc/rx PURE
Resident >NIL: CUCD:C/Version PURE
;;;
;;; Exit if InitCD has been run, otherwise ask
If {arg} EQ "CHECK"
If $CDInit EQ TRUE
Skip END
Else
set init `CUCD:C/RequestChoice "CU Amiga CD" "InitCD needs to be run first*NWould you like to run it now?" "Yes|No"`
If $init EQ 0
Skip END
EndIf
EndIf
EndIf
;;;
;;; Give option to run UninitCD
If $CDInit EQ TRUE
If $CDBoot EQ TRUE ; don't run UninitCD if booted from CD
CUCD:C/RequestChoice >NIL: "CU Amiga CD" "You do not need to run InitCD*Nwhen you have booted from the CD" "OK"
Skip END
EndIf
set remass `CUCD:C/RequestChoice "InitCD" "You have already run InitCD once.*NDo you wish to remove the assigns and paths added before?" "Remove|Cancel"`
If $remass EQ 1
execute UnInitCD
EndIf
Skip END
EndIf
;;;
;;; Set some system assigns and paths
Assign WWW: CUCD:CUCD/WWW
Assign tcpdldir: CUCD:CUCD/WWW
Assign CUCDNews: CUCD:CUCD/Online/News
Assign Twist: CUCD:CUCD/Magazine/Issues
Assign TwistIcon: Twist:Icons
Assign libx11: EXISTS >NIL:
If WARN
Assign libx11: CUCD:libs/libx11 ADD
EndIf
;;;
;;; Add MUI if no MUI installed.
Assign MUI: EXISTS >NIL:
IF WARN
Assign MUI: CUCD:CDsupport/MUI
Assign Libs: MUI:Libs ADD
Assign LOCALE: MUI:Locale ADD
Assign HELP: EXISTS >NIL:
If NOT WARN
Dir >NIL: HELP:
EndIf
Assign HELP: MUI:Docs ADD
EndIf
;;;
;;; Set assigns and paths for programs on this CD
Execute CUCD:S/ThisCD
;;;
;;;BEGIN ClassAct
CUCD:C/CAPrefs >NIL:
;;;END ClassAct
;;; Commands to be run only if booting from CD
IF $CDBoot EQ TRUE
Run <NIL: >NIL: C:NewIcons
CUCD:C/DefIcons
; Run these only if booting from a real CD32
Version >NIL:
if $kickstart EQ "40.60"
;C:CD2XSpeed
C:NoReset
EndIf
; Allow alternative screenmodes
if $CUCDscreen EQ "NTSC"
:Storage/Monitors/NTSC
:Prefs/ScreenMode from :Prefs/Presets/NTSC USE
:Prefs/Input from :Prefs/Presets/USkey USE
setenv VisageOpts MONITOR=NTSC
endif
if $CUCDscreen EQ "VGA"
:Storage/Monitors/DblPAL
:Prefs/ScreenMode from :Prefs/Presets/VGA USE
setenv VisageOpts MONITOR=DblPAL
endif
unsetenv CUCDscreen
;;;
;;; All this is only needed when not booting from the CD
Else
; Make sure LIBS: has up to date copy of asyncio.library, to fix problems with earlier InitCD
; Give option for setting CD preferences, make sure CUCDfile and IDer
; are in basic command path, so it will run without InitCD
If NOT EXISTS C:CUCDfile
Copy >NIL: CUCD:C/CUCDfile C: CLONE
EndIf
Version >NIL: C:IDer 1 6
If WARN
Copy >NIL: CUCD:C/IDer C: CLONE
EndIf
; ensure IDer.prefs are available
If NOT EXISTS ENV:IDer.prefs
If NOT EXISTS S:IDer.prefs
Version >NIL: version 39
If NOT WARN
Copy >NIL: CUCD:S/IDer.prefs S:IDer.prefs
set edit `RequestChoice "CU Amiga CD" "CUCD now has a preferences program to specify*N the tools used to view/hear different types of files.*NWould you like to run it now?" "Yes|No"`
If $edit EQ 1
cd CUCD:S
:RexxC/MuiRexx CUCDPrefs.mrx port CDPREFS
Else
RequestChoice >NIL: "CU Amiga CD" "You can run CUCD preferences at any time.*NIt is in the Prefs drawer of the CD" "OK"
EndIf
Else
Copy >NIL: CUCD:S/IDer.prefs_OS2 ENV:IDer.prefs
EndIf
EndIf
EndIf
; Make environment variables defined on CD available to system
Failat 21
Assign >NIL: ENV: CUCD:Prefs/Env-Archive ADD
; For HappyENV users
If FAIL
Assign >NIL: ENVARC: CUCD:Prefs/Env-Archive ADD
EndIf
;Start NewIcons if not already running
If $NoNewIcons NOT EQ TRUE
CUCD:C/isnirunning
If NOT WARN
Run <NIL: >NIL: CUCD:C/NewIcons
CUCD:C/DefIcons
EndIf
EndIf
; Update workbench paths unless running Directory Opus 5.11 or 5.5 in WBR mode
Version >NIL: C:LoadWB 43
If WARN
C:LoadWB NEWPATH
Else
Version >NIL: C:LoadWB 60
If NOT WARN
C:LoadWB NEWPATH
EndIf
EndIf
RequestChoice >NIL: "InitCD" "InitCD has set up some assigns and paths to run software from the CD.*NIf you wish to remove the CD from the drive, run InitCD again,*Notherwise the icon will stay on your Workbench." " OK "